package com.ssm.controller;

import com.ssm.pojo.Teacher;
import com.ssm.service.TeacherService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/teacher")
public class TeacherController {

    @Resource
    private TeacherService teacherService;

    @GetMapping("/selectOne")
    @ResponseBody
    public String selectOne() {
        Teacher teacher = teacherService.selectOne();
        return teacher.toString();
    }
}

